package com.ts.proj.repository;

import com.ts.base.repository.CommonRepository;
import com.ts.proj.entity.ProjectEntity;
import com.ts.util.PageData;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;


//说明 字符串：，作为替换字符串 LOWERProject                Project

public interface ProjectRepository extends CommonRepository<ProjectEntity> {

    @Query(value="  select t.pro_province as province,t.pro_city as city,count(*) as count  from ta_project t GROUP BY t.pro_province ,t.pro_city   ",nativeQuery = true)
    List<PageData> findAllProvinceProjects();


    @Query(value = "from ProjectEntity t where proName = ?1")
    List<ProjectEntity>  findProjectByProName(@Param("proName") String proName);
}